********************************************************************************
*	OVERVIEW
*		This is the master code for the paper: 
*		"Redesigning payments for ecosystem services to increase cost-effectiveness"
*		Santiago Izquierdo-Tort, Seema Jayachandran and Santiago Saavedra
********************************************************************************

	* Housekeeping
	macro drop _all
	*version 17
	cap log close		
	set more off 	
	clear all
	set maxvar 	30000
	set matsize 10000
	*ssc install unique
	*ssc install fre
	*net install cleanplots, from("https://tdmize.github.io/data/cleanplots")
	
	set scheme cleanplots, perm
	graph set window fontface "Abel"
	*==============================================================================*
	*========================       PREAMBLE          =============================*
	*==============================================================================*

	****** If ran independently, always run preamble first

	* Set directory to replication folder
	global maindir  "C:\Users\santiago.saavedrap\Dropbox\Research\PES Chiapas RCT\03_FollowUp\Replication folder" 	// Main folder directory

	cd "${maindir}"
	
	
	* Macros
	global raw "${maindir}\Data\raw"
	global temp "${maindir}\Data\temp"	
	global analysis "${maindir}\Data\analysis"	
	global figures "${maindir}\Output\figures"	
	global tables "${maindir}\Output\tables"	
	global numbers "${maindir}\Output\numbers"	
	global do "${maindir}\Dofiles"
	
	*========================      Cleaning        =============================*
	
	do "${do}\1 Cleaning.do"
	
	*========================      Analysis        =============================*
	
	do "${do}\2 Analysis.do"
